unit UPharmacyOrder;

interface

uses
  Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics,
  Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.ExtCtrls, AdvPanel, cxGraphics,
  cxControls, cxLookAndFeels, cxLookAndFeelPainters, cxContainer, cxEdit,
  dxSkinsCore, dxSkinBlack, dxSkinBlue, dxSkinBlueprint, dxSkinCaramel,
  dxSkinCoffee, dxSkinDarkRoom, dxSkinDarkSide, dxSkinDevExpressDarkStyle,
  dxSkinDevExpressStyle, dxSkinFoggy, dxSkinGlassOceans, dxSkinHighContrast,
  dxSkiniMaginary, dxSkinLilian, dxSkinLiquidSky, dxSkinLondonLiquidSky,
  dxSkinMcSkin, dxSkinMoneyTwins, dxSkinOffice2007Black, dxSkinOffice2007Blue,
  dxSkinOffice2007Green, dxSkinOffice2007Pink, dxSkinOffice2007Silver,
  dxSkinOffice2010Black, dxSkinOffice2010Blue, dxSkinOffice2010Silver,
  dxSkinPumpkin, dxSkinSeven, dxSkinSevenClassic, dxSkinSharp, dxSkinSharpPlus,
  dxSkinSilver, dxSkinSpringTime, dxSkinStardust, dxSkinSummer2008,
  dxSkinTheAsphaltWorld, dxSkinsDefaultPainters, dxSkinValentine, dxSkinVS2010,
  dxSkinWhiteprint, dxSkinXmas2008Blue, cxGroupBox, DBAdvGlowNavigator,
  cxStyles, dxSkinscxPCPainter, cxCustomData, cxFilter, cxData, cxDataStorage,
  cxNavigator, Data.DB, cxDBData, cxGridLevel, cxClasses, cxGridCustomView,
  cxGridCustomTableView, cxGridTableView, cxGridDBTableView, cxGrid, UDMPharmacy,
  cxTextEdit, cxMaskEdit, cxDropDownEdit, cxLookupEdit, cxDBLookupEdit,
  cxDBLookupComboBox, Vcl.StdCtrls, cxDBEdit, Vcl.Mask, Vcl.DBCtrls, cxCalendar,
  Vcl.Menus, cxButtons, UPharmacyOrderSub, frxClass, frxDBSet;

type
  TFPharmacyOrder = class(TForm)
    AdvPanel1: TAdvPanel;
    AdvPanelStyler1: TAdvPanelStyler;
    cxGroupBox1: TcxGroupBox;
    DBAdvGlowNavigator1: TDBAdvGlowNavigator;
    cxGrid1DBTableView1: TcxGridDBTableView;
    cxGrid1Level1: TcxGridLevel;
    cxGrid1: TcxGrid;
    AdvPanel2: TAdvPanel;
    Label1: TLabel;
    Label2: TLabel;
    cxDBDateEdit1: TcxDBDateEdit;
    cxDBTextEdit1: TcxDBTextEdit;
    cxGrid1DBTableView1pharmacy_order_id: TcxGridDBColumn;
    cxGrid1DBTableView1pharmacy_stock_id: TcxGridDBColumn;
    cxGrid1DBTableView1qty: TcxGridDBColumn;
    cxGrid1DBTableView1supplier_id: TcxGridDBColumn;
    cxButton1: TcxButton;
    cxButton2: TcxButton;
    his_pharmacy_order_report: TfrxDBDataset;
    ReOrder: TfrxReport;
    procedure DBAdvGlowNavigator1BtnCancel(Sender: TObject);
    procedure DBAdvGlowNavigator1BtnEdit(Sender: TObject);
    procedure DBAdvGlowNavigator1BtnFirst(Sender: TObject);
    procedure DBAdvGlowNavigator1BtnInsert(Sender: TObject);
    procedure DBAdvGlowNavigator1BtnLast(Sender: TObject);
    procedure DBAdvGlowNavigator1BtnNext(Sender: TObject);
    procedure DBAdvGlowNavigator1BtnPost(Sender: TObject);
    procedure DBAdvGlowNavigator1BtnPrior(Sender: TObject);
    procedure DBAdvGlowNavigator1BtnRefresh(Sender: TObject);
    procedure cxButton2Click(Sender: TObject);
    procedure cxButton1Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  FPharmacyOrder: TFPharmacyOrder;

implementation

{$R *.dfm}

procedure TFPharmacyOrder.cxButton1Click(Sender: TObject);
begin
  ReOrder.ShowReport();
end;

procedure TFPharmacyOrder.cxButton2Click(Sender: TObject);
begin
  FPharmacyOrderSub.Show;
end;

procedure TFPharmacyOrder.DBAdvGlowNavigator1BtnCancel(Sender: TObject);
begin
  Self.AdvPanel2.Enabled := false;
  DMPharmacy.his_pharmacy_order.Cancel;
end;

procedure TFPharmacyOrder.DBAdvGlowNavigator1BtnEdit(Sender: TObject);
begin
  Self.AdvPanel2.Enabled := true;
  DMPharmacy.his_pharmacy_order.Edit;
end;

procedure TFPharmacyOrder.DBAdvGlowNavigator1BtnFirst(Sender: TObject);
begin
  Self.AdvPanel2.Enabled := false;
  DMPharmacy.his_pharmacy_order.First;
end;

procedure TFPharmacyOrder.DBAdvGlowNavigator1BtnInsert(Sender: TObject);
begin
  Self.AdvPanel2.Enabled := true;
  DMPharmacy.his_pharmacy_order.Insert;
end;

procedure TFPharmacyOrder.DBAdvGlowNavigator1BtnLast(Sender: TObject);
begin
  Self.AdvPanel2.Enabled := false;
  DMPharmacy.his_pharmacy_order.Last;
end;

procedure TFPharmacyOrder.DBAdvGlowNavigator1BtnNext(Sender: TObject);
begin
  Self.AdvPanel2.Enabled := false;
  DMPharmacy.his_pharmacy_order.Next;
end;

procedure TFPharmacyOrder.DBAdvGlowNavigator1BtnPost(Sender: TObject);
begin
  Self.AdvPanel2.Enabled := true;
  DMPharmacy.his_pharmacy_order.Post;
  DMPharmacy.his_pharmacy_order.RefreshRecord;
  Self.AdvPanel2.Enabled := false;
end;

procedure TFPharmacyOrder.DBAdvGlowNavigator1BtnPrior(Sender: TObject);
begin
  Self.AdvPanel2.Enabled := false;
  DMPharmacy.his_pharmacy_order.Prior;
end;

procedure TFPharmacyOrder.DBAdvGlowNavigator1BtnRefresh(Sender: TObject);
begin
  Self.AdvPanel2.Enabled := false;
  DMPharmacy.his_pharmacy_order.RefreshRecord;
end;

end.
